/**
 * \file
 *           tlmRmtCfgSrvThread.cpp
 * \brief
 *           Implements tlmRmtCfgSrvThread class for Telematics
 *           this is the derived class from RPCThread clas.
 *
 * \par Author (last changes):
 *          - Zeng Jie
 *          - BUIC, Continental Automotive Holdings Co., Ltd.
 * \par Project Leader:
 *          -
 * \par Responsible Developer:
 *          - Zeng Jie
 *          - BUIC, Continental Automotive Holdings Co., Ltd.
 * \par Responsible Architect:
 *          - Zhang Fa
 *          - BUIC, Continental Automotive Holdings Co., Ltd.
 *
 * \par Project:
 *      DPCA2
 *
 * \par SW-Component:
 *      Telematics
 *
 * \par SW-Package:
 *      Telematics
 *
 * \par SW-Module:
 *      Telematics Application
 *
 * \par SW-Architecture Specification:
 *      DPCA2_TELEMATICS_SW_DD_07a_ready.doc
 *
* \par SW-Design Specification:
 *      DPCA2_TLM-RMTCFG_SW_DD_01d_released.doc
 *
 * \par SW-Test Case Specification:
 *
 * \par CM-Info:
 *
 * \note
 *      This is a note.
 *
 * \bug
 *      - there are no known bugs
 *
 * \par Module-History:
 *
 * \verbatim
 * Date                Author					Reason
 * 10 Dec 2013        Zeng Jie              Initial Creation
 * The latest entry at the head of the history list.
 * \endverbatim
 *
 * \par Copyright Notice:
 * Copyright (C) 2012 Continental Automotive Holdings Co., Ltd.
 * Alle Rechte vorbehalten. All Rights Reserved.\n
 * The reproduction, transmission or use of this document or its contents is
 * not permitted without express written authority.\n
 * Offenders will be liable for damages. All rights, including rights created
 * by patent grant or registration of a utility model or design, are reserved.
 *
 */

#include "StdAfx.h"
#include "tlmRmtCfgSrvThread.h"
#include "teleLogTrace.h"


/**
* \brief tlmRmtCfgSrvThread: This function is a contructor of tlmRmtCfgSrvThread
*
* \param
* - none
*
* \return
* - none
*
* \note
*/
tlmRmtCfgSrvThread::tlmRmtCfgSrvThread( char * name, ThreadPriorityType priority, ThreadStackSizeType stackSize ):
	RPCThread (name,priority,stackSize),ptlmRmtCfgSrvApp(NIL)
{

}

/**
* \brief ~tlmRmtCfgSrvThread: This function is a destructor of tlmRmtCfgSrvThread
*
* \param
* - none
*
* \return
* - none
*
* \note
*/
tlmRmtCfgSrvThread::~tlmRmtCfgSrvThread(void)
{

}

/**
* \brief instantiate:
*	 - This is a over load function of the RPC Thread.
	 - Instantiate the remote configuration application class.
*
* \param
* - none
*
* \return
* - none
*
* \note
*/
void tlmRmtCfgSrvThread::instantiate(void)
{
    //TODO:add log at here
    //LOG_PRINT(DPCA_TELE_MAIN_INFO,"[TLM_MSGSRV]:tlmRmtCfgSrvThread instantiate\n");
   
    ptlmRmtCfgSrvApp = const_cast<tlmRmtCfgSrvApp*>((tlmRmtCfgSrvApp::GetInstance()));
    if(ptlmRmtCfgSrvApp == NIL)
    {
	    //LOG_PRINT(DPCA_TELE_MAIN_ERROR,"[TLM_MSGSRV]:<tlmRmtCfgSrvThread::%s>, ptlmRmtCfgSrvApp is NIL\n", __FUNCTION__);
    }
}

/**
* \brief initialize:
*	 - This is a over load function of the RPC Thread.
*
* \param
* - none
*
* \return
* - none
*
* \note
*/
void tlmRmtCfgSrvThread::initialize(void)
{
    //TODO:add log at here
	//LOG_PRINT(DPCA_TELE_MAIN_INFO,"[TLM_MSGSRV]:<tlmRmtCfgSrvThread::%s>\n", __FUNCTION__);
    if(ptlmRmtCfgSrvApp != NIL)
    {
	    ptlmRmtCfgSrvApp->initialize();
    }
    else
    {
	    //LOG_PRINT(DPCA_TELE_MAIN_ERROR,"[TLM_MSGSRV]:<tlmRmtCfgSrvThread::%s>, ptlmRmtCfgSrvApp is NIL\n", __FUNCTION__);
    }

	
}

/**
* \brief initialize:
*	 - This is a over load function of the RPC Thread.
*	 - Release the handle of remote configuration Application
* \param
* - none
*
* \return
* - none
*
* \note
*
*/
void tlmRmtCfgSrvThread::deInitialize(void) const /*DG CPP2ISQP-ISQPcpp Rule 8.7.1-SCC_GRANT_0006*/
{
    //TODO:add log at here
	////LOG_PRINT(DPCA_MED_MAIN_INFO,"[MED][APP][BTM]:tlmRmtCfgSrvThread::deInitialize\r\n");
    if(ptlmRmtCfgSrvApp != NIL)
    {
        ptlmRmtCfgSrvApp->destroyInstance();
    }
    else
    {
	    //LOG_PRINT(DPCA_TELE_MAIN_ERROR,"[TLM_MSGSRV]:<tlmRmtCfgSrvThread::%s>, ptlmRmtCfgSrvApp is NIL\n", __FUNCTION__);
    }

}

/************** END OF FILE *****************/
